Array.prototype.add = function (item) {
    var a;
    a = this;
    a.push(item);
    return a;
};
Array.prototype.binaryIndexOf = function (item) {
    var vector;
    vector = this;
    if(vector.length) {
        var start = 0;
        var end = vector.length - 1;
        while(start <= end) {
            var middle = Math.floor((end - start) / 2) + start;
            if(vector[middle] == item) {
                return item;
            } else {
                if(vector[middle] < item) {
                    start = middle + 1;
                } else {
                    end = middle - 1;
                }
            }
        }
    }
    return -1;
};
Array.prototype.contains = function (lookingFor) {
    var a;
    a = this;
    for(var index = 0; index < a.length; index++) {
        if(a[index] === lookingFor) {
            return true;
        }
    }
    return false;
};
Array.prototype.firstOrDefault = function (predicate) {
    var a;
    a = this;
    if(predicate && typeof predicate === 'function') {
        for(var index = 0; index < a.length; index++) {
            if(predicate(a[index])) {
                return a[index];
            }
        }
    } else {
        if(a.length > 0) {
            return a[0];
        }
    }
    return null;
};
Date.prototype.getMillisTotal = function () {
    var d;
    d = this;
    var total = 0;
    total += d.getMilliseconds();
    total += d.getSeconds() * 1000;
    total += d.getMinutes() * 60 * 1000;
    total += d.getHours() * 60 * 60 * 1000;
    return total;
};
